﻿

Public Class MyTools

    Public Shared Function GetMidString(ByVal Text As String, ByVal DelimeryLeft As String, ByVal DelimeryRight As String) As String
        Dim s1 As String = ""
        Try
            If String.IsNullOrEmpty(Text) Then Return ""
            Dim x1 As Integer = InStr(Text.ToLower, DelimeryLeft.ToLower)
            If x1 = 0 Then
                s1 = Text
            Else
                s1 = Mid(Text, x1 + Len(DelimeryLeft))
            End If
            If String.IsNullOrEmpty(DelimeryRight) Then
                Return s1
            End If
            Dim x2 As Integer = InStr(s1, DelimeryRight.ToLower)
            If x2 = 0 Then
                Return s1
            Else
                s1 = Mid(s1, 1, x2 - 1)
            End If
            Return s1
        Catch ex As Exception
            Stop
        End Try
        Return ""
    End Function


End Class
